{% extends "base.html" %}
{% load staticfiles %}
{% block title %} 消费记录 {% endblock %}
{% block css %}
	{% include "common/_stylesheets.html" %}
    <!-- Datatables -->
    <link href="{% static 'vendors/datatables.net-bs/css/dataTables.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css' %}" rel="stylesheet">
{% endblock %}

{% block content %}
<div class="">
  <div class="page-title">
    <div class="title_left">
      <h3>计费管理<!-- <small> 用户基本信息管理 </small> --></h3>
    </div>
  </div>

  <div class="clearfix"></div>

  <div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
      <div class="x_panel">
        <div class="x_title">
          <h2>用户列表信息<!-- <small>Users</small> --></h2>
          <ul class="nav navbar-right">
	            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
	            </li>
	      </ul>
          <div class="clearfix"></div>
        </div>
        <div class="x_content">
          {% if request.session.usertype == 1 %}
          <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
            <thead>
            	<tr>
              		<th>Id</th>
			  		<th>项目名称</th>
			  		<th>消费金额(元)</th>
			  		<th>余额(元)</th>
			  		<th>vcpu消费金额(元)</th>
			  		<th>内存消费金额(元)</th>
			  		<th>磁盘消费金额(元)</th>
			  		<th>记录形成时间</th>
			  		<th>vcpu使用(核*时)</th>
			  		<th>vcpu使用单价(元)</th>
			  		<th>内存使用(GB*时)</th>
			  		<th>内存使用单价(元)</th>
			  		<th>磁盘使用(GB*时)</th>
			  		<th>磁盘使用单价(元)</th>
			  		<th>备注</th>
            	</tr>
            </thead>
            <tbody>
             		{% for list in contacts %}  
					   	<tr>  
						     <td>  {{ list.id }}    </td> 
						     <td>  {{ list.project_name }}  </td>
							 <td>  {{ list.consume_money }}    </td> 
							 <td>  {{ list.remaining_money }}</td>
							 <td>  {{ list.cpu_consume_money }} </td>
							 <td>  {{ list.memory_consume_money }} </td>
							 <td>  {{ list.disk_consume_money }} </td>
							 <td>  {{ list.record_time }} </td> 
						     <td>  {{ list.cpu_use_count }} </td> 
						     <td>  {{ list.cpu_price }} </td> 
						     <td>  {{ list.memory_use_count }} </td> 
						     <td>  {{ list.memory_price }} </td> 
						     <td>  {{ list.disk_use_count }} </td> 
						     <td>  {{ list.disk_price }} </td>
						     <td>  {{ list.extra }} </td>
					  	 </tr>  
				   {% endfor %}  
            </tbody>
          </table>
          {% else %}
          	 权限不通过
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock  %}
{% block js %} 
	{% include "common/_js.html" %}
    <!-- Datatables -->
	<script src="{% static 'vendors/datatables.net/js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-bs/js/dataTables.bootstrap.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-responsive/js/dataTables.responsive.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js' %}"></script>
    <script type="text/javascript">
	    $(document).ready(function(){
	    	
	    });
    </script>
{% endblock %}